using System.ComponentModel.DataAnnotations.Schema;

namespace Wips.Domain.Models.Authorities.Model
{
    /// <summary>
    /// 职位用户
    /// </summary>
    [Table("AuthorityPositionUsers")]
    [SugarTable("AuthorityPositionUsers")]
    public class PositionUser : ValueObjectBase
    {
        /// <summary>
        /// 职位ID
        /// </summary>
        public string PositionId { get; set; }

        /// <summary>
        /// 职位
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(PositionId))]
        public Position Position { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        [Navigate(NavigateType.ManyToOne, nameof(UserId))]
        public User User { get; set; }

        public PositionUser()
        {
        }

        public PositionUser(string positionId, string userId)
        {
            PositionId = positionId;
            UserId = userId;
        }
    }
}